#ifndef COLOR_H
#define COLOR_H

#include <cstdint>

namespace ColorTree
{
    class Color
    {
    public:
        Color(uint8_t r, uint8_t g, uint8_t b);
        Color(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7);

        [[nodiscard]] inline uint8_t GetR() const { return color[0]; }
        [[nodiscard]] inline uint8_t GetG() const { return color[1]; }
        [[nodiscard]] inline uint8_t GetB() const { return color[2]; }

        [[nodiscard]] inline uint8_t GetB0() const { return colorBit[0]; }
        [[nodiscard]] inline uint8_t GetB1() const { return colorBit[1]; }
        [[nodiscard]] inline uint8_t GetB2() const { return colorBit[2]; }
        [[nodiscard]] inline uint8_t GetB3() const { return colorBit[3]; }
        [[nodiscard]] inline uint8_t GetB4() const { return colorBit[4]; }
        [[nodiscard]] inline uint8_t GetB5() const { return colorBit[5]; }
        [[nodiscard]] inline uint8_t GetB6() const { return colorBit[6]; }
        [[nodiscard]] inline uint8_t GetB7() const { return colorBit[7]; }

    private:
        uint8_t color[3]{};
        uint8_t colorBit[8]{};
    private:
        void ColorToBit();
        void BitToColor();
    };
}

#endif //COLOR_H
